<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function check() {
            name=document.getElementById("name").value;
            pwd=document.getElementById("pwd").value;
            if (name=="张三" && pwd=="123456"){
                alert("登陆成功");
            } else {
                alert("用户名或密码输入有误");
            }
        }
    </script>
</head>
<body>
<input type="text" id="name" placeholder="请输入用户名">
<input type="password" id="pwd" placeholder="请输入密码">
<input type="button" value="登录" onclick="check()">

</body>
</html>